FROM golang:1.19 AS builder

COPY . /src
WORKDIR /src

RUN GOPROXY=https://goproxy.cn make all & make build

FROM debian:stable-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
		ca-certificates  \
        netbase \
        && rm -rf /var/lib/apt/lists/ \
        && apt-get autoremove -y && apt-get autoclean -y

COPY --from=builder /src/bin /app

WORKDIR /app

EXPOSE 8000
EXPOSE 9000
VOLUME /data/conf

CMD ["./server", "-conf", "/data/conf"]


# 构建 docker build -t go-template ./
# ENTRYPOINT 启动命令 docker run -itd -v /data/conf -v /Users/medcon/liwei/goSpace/go-kratos-template/configs/dev -p 8000:8000 -p 9000:9000  --name gotemplate  go-template
# 访问地址 ： http://127.0.0.1:8000/demo/hello
